fix: translate keys - #4229
Conversation
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Pull request overview
This PR improves the readability of stewardship escalation activity logs by converting stored escalation resolution path enum values (e.g. namespace_takeover) into human-friendly labels when writing the stewardship_activity.content, while still preserving the raw enum in metadata.resolutionPath.
Changes:
- Added
ESCALATION_RESOLUTION_PATH_LABELS: Record<EscalationResolutionPath, string>to map all resolution paths to human-readable labels. - Updated
escalateStewardship()to use the label map when generating the activity logcontentstring.
Note: the PR title (fix: translate keys) is missing the required JIRA key suffix per .claude/rules/commit-workflow.md (“Format: type: description (CM-XXX)”).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
50e455f to
efaaa0c
Compare
Summary
The stewardship escalation activity log was storing the raw enum value as the resolution path (e.g.
namespace_takeover), making it unreadable for end users. This PR adds a human-readable label map and uses it when writing the activity log content.Changes
ESCALATION_RESOLUTION_PATH_LABELS— aRecord<EscalationResolutionPath, string>map that covers all 6 resolution paths; TypeScript enforces exhaustiveness at compile timeescalateStewardship()to use the label in thecontentfield of the activity log entry (e.g."Escalated with resolution path: Namespace Takeover"instead of"...namespace_takeover"); the raw enum value is still preserved inmetadata.resolutionPathType of change
Note
Low Risk
Display-only mapping on read paths; raw enum values remain in the database and metadata unchanged.
Overview
Escalation activity messages no longer surface raw resolution-path enum keys (e.g.
namespace_takeover) in API responses.A shared
ESCALATION_RESOLUTION_PATH_LABELSmap andtranslateActivityContentturn stored content and/ormetadata.resolutionPathinto readable labels (with a regex fallback for legacy rows that only have the key incontent).listPackagesForApinow selectslastActivityMetadataso the public package list can translatelastActivity.contentthe same way as the stewardship activity feed and package history.Reviewed by Cursor Bugbot for commit de639e8. Bugbot is set up for automated code reviews on this repo. Configure here.